//package com.ckm.config;
//
//import com.ckm.datasource.DynamicMongoFactory;
//import com.ckm.listener.DynamicMongeSourceListener;
//import com.mongodb.client.MongoChangeStreamCursor;
//import com.mongodb.client.model.changestream.ChangeStreamDocument;
//import lombok.RequiredArgsConstructor;
//import org.bson.Document;
//import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.data.mongodb.MongoDatabaseFactory;
//import org.springframework.data.mongodb.core.MongoTemplate;
//
//@Configuration
//@RequiredArgsConstructor
//public class MongoWatchConfig {
//
//    private final DynamicMongoFactory dynamicMongoFactory;
//
//    @Bean
//    @ConditionalOnMissingBean
//    public DynamicMongeSourceListener dynamicMongeSourceListener(){
//        return new DynamicMongeSourceListener(dynamicMongoFactory.getDefaultTargetMongoDatabaseFactory());
//    }
//}
